package com.itbaima.controller;

import com.itbaima.pojo.entity.Salary;
import com.itbaima.service.SalaryQueryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/cpi/salary-standards")
public class SalaryQueryController {

    private final SalaryQueryService salaryQueryService;

    // 构造方法注入 SalaryQueryService
    public SalaryQueryController(SalaryQueryService salaryQueryService) {
        this.salaryQueryService = salaryQueryService;
    }

    // 获取所有薪酬标准
    @GetMapping
    public List<Salary> getSalaryStandards() {
        return salaryQueryService.getAllSalaryStandards();
    }
}
